<template>
  <div id="roleManagementAddRole">
    <Table @submitRole="submitRole"/>
  </div>
</template>

<script>
import {
  createRole
} from '@/assets/request/api.js';
import Table from './table.vue';

export default {
    name: "roleManagementAddRole",
    data() {
      return {
        
      };
    },
    methods: {
      submitRole(roleForm) {
        createRole(roleForm).then(res => {
          this.$message({
            message: '添加成功',
            type: 'success'
          });
          this.$router.go(-1)
        }).catch(err => {
          this.$message({
            message: err.message,
            type: 'error'
          });
        })
      }
    },
    created() {
    },
    components: { Table }
}
</script>

<style scoped lang="scss">




 
</style>
